package com.ytg.myapi.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

import com.ytg.myapi.BindWay;

import androidx.annotation.DrawableRes;

/**
 * Created by ximsfei on 2017/1/10.
 */

public class SkinCompatTextView extends androidx.appcompat.widget.AppCompatTextView {

    public SkinCompatTextView(Context context) {
        this(context, null);
    }

    public SkinCompatTextView(Context context, AttributeSet attrs) {
        this(context, attrs, android.R.attr.textViewStyle);
    }

    public SkinCompatTextView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }


    @Override
    public void setBackgroundResource(@DrawableRes int resId) {
        super.setBackgroundResource(resId);
    }

    @Override
    public void setText(CharSequence text, TextView.BufferType type) {
        super.setText(text, type);
        if (null != BindWay.getInstance().textBack) {
            BindWay.getInstance().textBack.back(getId(), getTag() + "", text.toString());
        }
    }


}
